<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<body>
<div id="joke" style="width:200px; height:200px">
    <input type="button" value="获取笑话" @click="getJoke">
    <p>{{message}}</p>
</div>
</body>
<script>
    var app = new Vue({
        el: "#joke",
        data: {
            message: "讲个笑话"
        },
        methods: {
            getJoke: function () {
                var that = this;
                axios.get("https://autumnfish.cn/api/joke").then(function (response) {
                    that.message = response.data
                }, function (err) {
                    console.log(err)
                })
            }
        }
    })
</script>
</html>